using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Log2SQL
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            Application.Run(new MainForm());
        }

        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            if (MessageBox.Show("Unhandled error. Press OK to copy the error description to the clipboard, so you can send it to developers later\r\n\r\n" + e.Exception.ToString(), "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
                == DialogResult.OK)
            {
                Clipboard.SetDataObject(e.Exception.ToString(), true);
            }
            Application.Exit();
        }
    }
}